<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
<style>
.all_list select {
	height: 22px;
	line-height: 22px;
	width: 80px;
}
.editor table {
	display: inline;
	vertical-align: top;
}

</style>

<form id="add_form" action="">
	<ul class="all_list">
		<li>
			<span class="all_title">标题：</span>
			<span>
				<input class="ui_input" id="title1" validator='{"label":"标题"}'  name="title" style="width:250px;">
			</span>
		</li>
		<li>
			<span class="all_title">有效时间：</span>
				<span>
					<!-- <input type="text" class=" Wdate" id="beginDate1" name="beginDate" value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',minDate:'%y-%M-%d %H:%m',maxDate:'#F{$dp.$D(\'endDate1\')}'})"> -
					<input type="text" class=" Wdate" id="endDate1" name="endDate" value=""  validator='{"label":"有效时间","required":true}' onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',minDate:'#F{$dp.$D(\'beginDate1\')}'})"> -->
					<input type="text" id="beginDate1" name="beginDate" class="ui_input datepicker Wdate" dateFormat="yyyy-MM-dd HH:mm" group='{"group": {"startId":"beginDate1", "endId":"endDate1","showNext": true}}' option='start-auto-end' /> - <input type="text" id="endDate1" name="endDate" dateFormat="yyyy-MM-dd HH:mm" class="ui_input datepicker Wdate" validator='{"label":"有效时间","required":true}' option='start-auto-end'/>
				</span>
		</li>
		<li class="editor m-t10">
			<span class="all_title">内容：</span> 
			<span>
				<textarea id="content1" name="content"  class="xheditor {tools:'FontSize,FontColor,Bold,Italic,Underline,Strikethrough,Fullscreen,Align,About',skin:'default',height:'300'}" rows="8" cols="80" style="width:70%">
				</textarea>
				<span id="contentError"></span>
			</span>
		</li>
		<li>
			<span class="all_title"></span>
			<span> 
				<input type="button" id="query" value="发布" class="btn_blue m-r15 submitBtn">
				<input type="reset" id="reset_button" value="重置" class="reset_btn m-r15">
			</span>
		</li>
	</ul>
</form>
<script type="text/javascript">
$.datepicker();
	$(function(){
		$('#content1').xheditor();
		$("#add_form").validator({}, {
			callback:function(data){
				var x = $("#content1").val();
				if(x.trim()==''){
					alert("内容不能为空");
					return;
				}
				var param = {};			
				var paramArray = $('#add_form').serializeArray();
				for (var i in paramArray) {
					param[paramArray[i].name] = paramArray[i].value;
				}
				$.post('portalnotification/add',param,function(data){
					/* myDialog.content(result); */
					art.dialog({icon: data.success,content: data.message,lock:true});
					if (data.success == "succeed") {
						myDialog.close();
						$("#gridTable").jqGrid("setGridParam",{datatype : 'json'}).trigger("reloadGrid", [ {page : 1} ] );
					}
				});
			}
		});
	});

	
</script>